﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Controls;
using Hotel.NhanVien;
using Hotel.QLPhong;
using Hotel.DichVu;
using Hotel.ThongKe;

namespace Hotel
{
    public partial class Frmmain : Office2007RibbonForm
    {
        QuanLiTaiKhoan formTaiKhoan = null;
        QuanLiLuong formLuong = null;
        ThongKeDichVu formTKDV = null;
        ThongKeDoanhThu formTKDT = null;
        ThongKeKhachHang formTKKH = null;
        ThongKePhong formTKPhong = null;
        string tentaikhoan;
        public Frmmain(string _tentaikhoan)
        {
            InitializeComponent();
            this.tentaikhoan = _tentaikhoan;
        }

        private void Frmmain_Load(object sender, EventArgs e)
        {
            MessageBox.Show(tentaikhoan);
        }

        QL_dichvu formQLDV = null;
        private void ribbonTabItem1_Click(object sender, EventArgs e)
        {
            if (formQLDV == null || formQLDV.IsDisposed)
            {
                formQLDV = new QL_dichvu();
                formQLDV.MdiParent = this;
                formQLDV.Show();
            }
            else formQLDV.Activate();
        }

        Quanlynhanvien formQLNV = null;
        private void btnttnv_Click(object sender, EventArgs e)
        {
            if (formQLNV == null || formQLNV.IsDisposed)
            {
                formQLNV = new Quanlynhanvien();
                formQLNV.MdiParent = this;
                formQLNV.Show();
            }
            else formQLNV.Activate();
        }

        QL_phong formphong = null;
        private void rbt_phong_Click(object sender, EventArgs e)
        {
            if (formphong == null || formphong.IsDisposed)
            {
                formphong = new QL_phong();
                formphong.MdiParent = this;
                formphong.Show();
            }
            else formphong.Activate();
        }

        private void btndangnhap_Click(object sender, EventArgs e)
        {

        }

        private void btnLuong_Click(object sender, EventArgs e)
        {
           
            if (formLuong == null || formLuong.IsDisposed)
            {
                formLuong = new QuanLiLuong();
                formLuong.MdiParent = this;
                formLuong.Show();
            }
            else formLuong.Activate();
        }

        private void btnTaiKhoan_Click(object sender, EventArgs e)
        {
            
            if (formTaiKhoan == null || formTaiKhoan.IsDisposed)
            {
                formTaiKhoan = new QuanLiTaiKhoan(tentaikhoan);
                formTaiKhoan.MdiParent = this;
                formTaiKhoan.Show();
            }
            else formTaiKhoan.Activate();
        }

        private void btndoanhthu_Click(object sender, EventArgs e)
        {
            if (formTKDT == null || formTKDT.IsDisposed)
            {
                formTKDT = new ThongKeDoanhThu();
                formTKDT.MdiParent = this;
                formTKDT.Show();
            }
            else formTKDT.Activate();
        }

        private void btnphong_Click(object sender, EventArgs e)
        {
            if (formTKPhong == null || formTKPhong.IsDisposed)
            {
                formTKPhong = new ThongKePhong();
                formTKPhong.MdiParent = this;
                formTKPhong.Show();
            }
            else formTKPhong.Activate();
        }

        private void btnkhachhang_Click(object sender, EventArgs e)
        {
            if (formTKKH == null || formTKKH.IsDisposed)
            {
                formTKKH = new ThongKeKhachHang();
                formTKKH.MdiParent = this;
                formTKKH.Show();
            }
            else formTKKH.Activate();
        }

        private void btndichvu_Click(object sender, EventArgs e)
        {
            if (formTKDV == null || formTKDV.IsDisposed)
            {
                formTKDV = new ThongKeDichVu();
                formTKDV.MdiParent = this;
                formTKDV.Show();
            }
            else formTKDV.Activate();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            lbtqlp.Text = lbtqlp.Text.Substring(1, lbtqlp.Text.Length - 1) + lbtqlp.Text.Substring(0, 1);
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            lbtqldv.Text = lbtqldv.Text.Substring(1, lbtqldv.Text.Length - 1) + lbtqldv.Text.Substring(0, 1);
        }

        private void Frmmain_FormClosing(object sender, FormClosingEventArgs e)
        {
            new Longin().Show();
        }

        private void btnxthoat_Click(object sender, EventArgs e)
        {
            this.Dispose();
            new Longin().Show();
        }       
    }
}
